class Computer {
    private String cpu; //cpu(中央处理器)
    public String ram; // 内存
    String disk; //磁盘
    public Computer(String cpu, String ram, String disk) {
        this.cpu = cpu;
        this.ram = ram;
        this.disk = disk;
    }

    public void Boot() {
        System.out.println("开机");
    }

    public void shutdown() {
        System.out.println("关机");
    }
}
public class Demo1 {
    public static void main(String[] args) {
        Computer pc = new Computer("12th Gen Intel(R) Core(TM) i7-12700H   2.30 GHz","16.0 GB","512 GB");
        System.out.println(pc.ram); // 可以在其他类访问
        System.out.println(pc.disk); //只能被本包中的类访问
//        System.out.println(pc.cpu); // 不可访问
    }
}






























